package com.learning.spring.security.pwd.store.config;

import com.learning.spring.security.pwd.store.userdetails.CustomUserDetailsService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * ClassName: SecurityConfig
 * Description: 密码存储
 * Date: 2022/7/29 9:14
 *
 * @author Sam Sho
 * @version V1.0.0
 */
@Configuration
public class CustomSecurityConfig {


    /**
     * 自定义数据存储 UserDetailsService
     * 只有没有 AuthenticationManagerBuilder 和没有定义 AuthenticationProviderBean 的情况下，这个配置才会生效
     *
     * @return
     */
    @Bean
    CustomUserDetailsService customUserDetailsService() {
        return new CustomUserDetailsService();
    }

}
